//获取应用实例
const app = getApp();

Page({
	data: {
    orderdetail:[],
  },
	onLoad: function() {
    console.log(app.globalData.orderdetail)
    this.setData({
      orderdetail: app.globalData.orderdetail
    })
    this.getLogisticsMsg()
      // this.setData({
      //   app.globalData.orderdetail
      // })
  },

  getLogisticsMsg(){
    var that=this;
    console.log(app.globalData.token)
    console.log(that.data.orderdetail.detail[0].logistics_type)
    console.log(that.data.orderdetail.detail[0].logistics)
    console.log(that.data.orderdetail.detail[0].express_number)
    console.log(that.data.orderdetail.contact_number)
    wx.request({
      url: app.globalData.api + '/index.php/wap/Order/getLogisticsMsg',
      data:
      {
        'token': app.globalData.token,
        'logistics_type': that.data.orderdetail.detail[0].logistics_type,
        'logistics': that.data.orderdetail.detail[0].logistics,
        'express_number': that.data.orderdetail.detail[0].express_number,
        'phone': that.data.orderdetail.contact_number
      },
      headers: {
        'platform': '' + app.globalData.platform,
        'version': '' + app.globalData.version,
      },
      method: 'POST',
      dataType: 'json',
      success: function (res) {
        console.log(res);
        if (res.data.code == 1) {

        }
        wx.showToast({
          title: '' + res.data.msg,//提示文字
          duration: 2000,//显示时长
          mask: true,//是否显示透明蒙层，防止触摸穿透，默认：false  
          icon: 'success', //图标，支持"success"、"loading"  
          success: function () { },//接口调用成功
          fail: function () { },  //接口调用失败的回调函数  
          complete: function () { } //接口调用结束的回调函数  
        })
      }, fail: function () {

      }
    });
  }


});
